<extend name="Public/base" />

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>商品评价({$_total})</h2>
	</div>
	<div>
    <if condition="I('get.item_id')">
      <a href="{:U('add', array('item_id' => I('get.item_id')))}" class="btn">新增评价</a>
      <a class="btn" href="{:U('index')}">刷 新 <span style="font-size:12px;font-weight:normal">(清空搜索条件)</span></a>
    </if>
	</div>
    <div class="cf">
        <div class="fl">
            <button class="btn ajax-post confirm" target-form="ids" url="{:U('Order/cancel')}">取 消</button>
            <a class="btn" href="{:U('index')}">刷 新</a>
        </div>
        <!-- 高级搜索 -->
        <form action="{:U()}" method="GET" id="J_search_form">
            <div class="search-form fr cf">

                <div class="sleft">
                    <select id="time_type" class="fl">
                        <option value="create_time">评价时间</option>
                    </select>
                    <input type="text" name="start_time" class="search-input w-100 date_select" value="{:I('get.start_time')}" placeholder="开始"/>
                    <span class="fl line-h">至</span>
                    <input type="text" name="end_time" class="search-input w-100 date_select" value="{:I('get.end_time')}" placeholder="结束"/>
                </div>
                <div class="sleft">
                    <!--<input type="text" name="keywords" class="search-input input-2x" value="{:I('keywords')}" placeholder="订单编号">-->
                    <input type="text" name="keywords" class="search-input input-2x" value="{:I('keywords')}" placeholder="店铺名、商品名称、用户名">
                    <a class="sch-btn" href="javascript:;" id="J_search"><i class="btn-search"></i></a>
                </div>
            </div>
        </form>
    </div>
	<!-- 数据列表 -->
	<div class="data-table table-striped">
		<table>
			<thead>
				<tr>
					<th>ID</th>
					<th>评价星级</th>
					<th >评价商品</th>
					<th>评价用户</th>
					<th>评价时间</th>
					<th width="500">评价内容</th>
					<th>是否回复</th>
          <th>操作</th>
				</tr>
			</thead>
			<tbody>
				<notempty name="lists">
				<volist name="lists" id="vo">
				<tr>
					<td>{$vo.id}</td>
					<td>{$vo.star_amount}</td>
					<td>
					   <a href="{:U('/Item/detail?id='.$vo['item_id'])}" target="_blank">{:get_item_name($vo['item_id'],10)}</a>
                    </td>
					<td>
            <if condition="0 eq $vo['uid']">
              {$vo.nickname}
            <else />
             <a href="{:U('User/view', array('id' => $vo['uid']))}">{$vo.uid|get_nickname}</a>
            </if>    
          </td>
					<td>{$vo.create_time|time_format}</td>
					<td>{:get_short($vo['content'],25)}</td>
					<td>
            <if condition="get_item_comment_reply($vo['id'])">
              <span class="text-success">已回复</span>
            <else />
              <span class="text-danger">未回复</span>
            </if>
          </td>
          <td>
           <!-- <a href="javascript:;" onclick="UI.load('{:U('reply?id='.$vo['id'])}', '回复评价')">[回复]</a>
            <a href="{:U('edit?id='.$vo['id'])}">[编辑]</a>-->
            <a href="{:U('setStatus?status=-1&ids='.$vo['id'])}" class="confirm ajax-get">[删除]</a>
          </td>
				</tr>
				</volist>
				<else/>
				<td colspan="6" class="text-center"> aOh! 暂时还没有内容! </td>
				</notempty>
			</tbody>
		</table>
	</div>
	<!-- 分页 -->
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
    <script src="__PUBLIC__/Admin/js/My97Date/WdatePicker.js"></script>

    <script type="text/javascript">
        highlight_subnav("{:U('index')}");
        //时间选择
        $('.date_select').focus(function(){
            WdatePicker({skin: 'twoer', dateFmt: 'yyyy-MM-dd', maxDate: '%y-%M-%d'});
        });
    </script>
</block>